<!--预警详情-->
<template>
    <div class="warnInfo">
        <div class="demo-tabs">
            <el-tabs v-model="state.tabsVal" @tab-click="handleClick">
                <el-tab-pane label="已处理" name="handle"></el-tab-pane>
                <el-tab-pane label="未处理" name="notHandle"></el-tab-pane>
            </el-tabs>
            <el-select v-model="state.selectVal" class="m-2">
                <el-option v-for="item in state.selectData" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
        </div>

        <div class="warnInfo_content">
            <div class="fl">
                <div class="titles">预警信息</div>
                <el-scrollbar max-height="450px" height="450px">
                    <CustomSafetySpyModalWarningTemplate
                        :list-data="state.warnData"
                    ></CustomSafetySpyModalWarningTemplate>
                </el-scrollbar>
            </div>
            <div class="fr">
                <el-scrollbar max-height="550px" height="550px">
                    <div style="height: 100%">
                        <h3>数据片段</h3>
                        <chartView
                            :chart-option="EchartsMethods.warnInfoLine()"
                            :auto-resize="true"
                            style="height: 40%"
                            height="100%"
                        ></chartView>

                        <h3>数据片段</h3>
                        <chartView
                            :chart-option="EchartsMethods.warnInfoLine()"
                            :auto-resize="true"
                            style="height: 40%"
                            height="100%"
                        ></chartView>
                        <div>
                            <el-button class="ignore" @click="hide">忽略</el-button>
                            <el-button type="primary" @click="hide">处理</el-button>
                        </div>
                    </div>
                </el-scrollbar>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue';
import type { TabsPaneContext } from 'element-plus';
import { EchartsMethods } from '@/chart/index';
import chartView from '@/chart/index.vue';

const emit = defineEmits(['hiden']);
const state = reactive({
    warnData: [
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        }
    ],
    tabsVal: 'handle',
    selectVal: '安监',
    selectData: [
        {
            value: '安监',
            label: '安监'
        },
        {
            value: '总览',
            label: '总览'
        }
    ]
});

const hide = () => {
    emit('hiden', false);
};
const handleClick = (tab: TabsPaneContext) => {
    console.log(tab, 'tab');
};
</script>
<style scoped lang="scss">
.demo-tabs {
    padding-right: 30px;
    box-sizing: border-box;
    margin-bottom: 10px;
    position: relative;
    .m-2 {
        position: absolute;
        right: 30px;
        top: 0;
        width: 12%;
        ::v-deep(.select-trigger) {
            width: 100%;
        }
        ::v-deep(.el-input__inner) {
            color: rgba($color: #dfeef3, $alpha: 0.7);
            font-size: 12px;
        }
        ::v-deep(.el-input__wrapper) {
            background: rgba($color: #fff, $alpha: 0.12) !important;
            box-shadow: none;
        }
    }
    ::v-deep(.el-tabs__item) {
        color: #fff;
        font-size: 18px;
    }
    ::v-deep(.is-active) {
        color: #0e96ff;
    }
    ::v-deep(.el-tabs__nav-wrap::after) {
        background: rgba($color: #0e96ff, $alpha: 0.28);
    }
    ::v-deep(.el-tabs__active-bar) {
        background: #0e96ff;
    }
}
.warnInfo {
    padding: 15px 0px 10px 30px;
    box-sizing: border-box;
    &_content {
        display: flex;
    }
    .titles {
        background: rgba(14, 150, 255, 0.28);
        font-size: 18px;
        color: #fff;
        text-align: center;
        padding: 10px 0;
        letter-spacing: 2px;
    }
    .fl {
        width: max-content;
        min-width: 33%;
    }
    .fr {
        flex: 1;
        margin-left: 20px;
        ::v-deep(.el-scrollbar__view) {
            height: 100%;
        }
        ::v-deep(.ignore) {
            color: #fff;
            background: rgba($color: #fff, $alpha: 0.1);
            border: none;
        }
        ::v-deep(.el-button) {
            padding: 14px 24px;
        }
        h3 {
            font-size: 18px;
            color: #1b93fb;
            margin-bottom: 10px;
        }
    }
}
</style>
